import * as React from "react";
import Create from './Create/index';
import Query from './Query/index';
import { Tab, Tabs } from "@blueprintjs/core";

class User extends React.PureComponent {
    constructor(props) {
        super(props);
        this.handleTabChange = this.handleTabChange.bind(this);
        this.state = {
            chooseType: "create"
        }
    }

    componentDidMount() {}

    handleTabChange(id) {
        this.setState({
            chooseType: id
        })
    }
    render() {
        const {chooseType} = this.state;
        return(
            <div>
                <Tabs id="insert-record" onChange={this.handleTabChange} selectedTabId={chooseType}>
                    <Tab id="create" title="新增用户" panel={<Create/>} key="create"/>
                    <Tab id="query" title="查询用户" panel={<Query/>} key="query"/>
                </Tabs>
            </div>
        )
    }
}

export default User;